<?php
namespace app\index\controller;
use think\Model;
use think\Db;
require_once 'AipOcr.php';
// 你的 APPID AK SK
const APP_ID = '15835029';
const API_KEY = 'A8kkwt1pbrKN44tOpqRf6uH6';
const SECRET_KEY = 'GpmaONrh5N6w9TXYXLpZ5FU2qvbLSDfG';

class Gp extends Model{ 
      //自定义初始化
    protected function initialize()
    {
        //需要调用`Model`的`initialize`方法
        parent::initialize();
        //TODO:自定义的初始化
    }

//http://localhost:8888/gp/tp5/public/index/gp/index
//http://localhost:8888/tp5/public/index/gp/index?gp_no=1
    public function index(){

        $client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);

    	// $gp = new Gp();
    	// $data = $gp->select();
    	// $jsonData = array('data' => $data); 
    	// return json_encode($jsonData);
    }

    // public function getData(){
    // 	$gp = new Gp();
    // 	$data = $gp->limit(20)->select();

    // 	//-> where('gp_no', 603938)
    // 	$jsonData = array('data' => $data); 
    //   return json_encode($jsonData);
    // }
}
?>